package com.novax.ex.activity.open.api.inner;

import com.novax.ex.activity.open.model.query.MallAdjustmentHistoryQuery;
import com.novax.ex.activity.open.model.request.MallWinnerMemoRequest;
import com.novax.ex.activity.open.model.response.MallAdjustmentHistoryResponse;
import com.novax.ex.activity.open.model.response.MallAdjustmentMemoResponse;
import com.novax.ex.activity.open.model.response.MallAdjustmentResponse;
import com.novax.ex.common.results.ReturnResult;
import com.novax.ex.common.util.PageQuery;
import com.novax.ex.common.util.PageUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Description: 结果调整
 *
 * @author Deucalion@novax.email
 * @date 2023/3/30 15:00
 */
@Tag(name = "一元购-结果调整", description = "结果调整")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "MallAdjustmentInnerApi", contextId = "MallAdjustmentInnerApi")
public interface MallAdjustmentInnerApi {
    @Operation(summary = "结果调整", description = "结果调整")
    @GetMapping("/v3/private/mall/adjustment/list")
    ReturnResult<PageUtil<MallAdjustmentResponse>> list(
            @RequestHeader("language") String language,
            @ParameterObject PageQuery query);

    @Operation(summary = "历史调整", description = "历史调整")
    @GetMapping("/v3/private/mall/adjustment/history")
    ReturnResult<PageUtil<MallAdjustmentHistoryResponse>> history(
            @RequestHeader("language") String language,
            @ParameterObject MallAdjustmentHistoryQuery query);

    @Operation(summary = "备注", description = "备注")
    @Parameters({
            @Parameter(name = "mallPrizeId",description = "奖品ID")
    })
    @GetMapping("/v3/private/mall/adjustment/memo")
    ReturnResult<List<MallAdjustmentMemoResponse>> memo(
            @RequestHeader("language") String language,
            @RequestParam("mallPrizeId") Long mallPrizeId);

    @Operation(summary = "指定为最终购买者", description = "指定为最终购买者")
    @Parameters({
            @Parameter(name = "language",description = "语言"),
            @Parameter(name = "adminId",description = "管理员ID"),
            @Parameter(name = "orderId",description = "订单ID"),
            @Parameter(name = "userId",description = "用户ID")
    })
    @PostMapping("/v3/private/mall/adjustment/appoint")
    ReturnResult appoint(
            @RequestHeader("language") String language,
            @RequestParam("adminId") Long adminId,
            @RequestParam("orderId") Long orderId,
            @RequestParam("userId") Long userId);

    @Operation(summary = "取消指定", description = "取消指定")
    @Parameters({
            @Parameter(name = "language",description = "语言"),
            @Parameter(name = "adminId",description = "管理员ID"),
            @Parameter(name = "mallPrizeId",description = "奖池商品id")
    })
    @PostMapping("/v3/private/mall/adjustment/cancel-appoint")
    ReturnResult cancelAppoint(
            @RequestHeader("language") String language,
            @RequestParam("adminId") Long adminId,
            @RequestParam("mallPrizeId") Long mallPrizeId);
}
